<?php

namespace console\migrations;

use console\migrations\Base;

/**
 * Handles the creation of table `{{%patch}}`.
 */
class M200810020011CreatePatchTable extends Base
{

    protected string $tableName = '{{%patch}}';
    protected string $tableComment = '';

    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable( $this->tableName, [
            'id'     => $this->primaryKey(),
            'title'  => $this->string( 255 )->notNull()->defaultValue( '' ),
            'detail' => $this->text(),
            'created_at'  => $this->dateTime(),
            'updated_at' => $this->dateTime()
        ], $this->tableOptions );
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable( '{{%patch}}' );
    }
}
